﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Yitter.IdGenerator;

namespace StarsAdmin.Core.DB.Entities
{
    /// <summary>
    /// 主键Id实体
    /// </summary>
    public class BaseIdEntity : IBaseIdEntity
    {
        /// <summary>
        /// 主键Id
        /// </summary>
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.None)] // 确保主键不由数据库生成
        public long Id { get; set; } = YitIdHelper.NextId();
    }
}